package tree;

/**
 * @author zhaoziqiang
 * @Description:
 * @date 2020/9/3 17:24
 */
public class Test {
    public static void main(String[] args) {
        BStree<Integer> bStree = new BStree<>();
        int[] nums = {5, 3, 6, 8, 4, 2};
        for (int i = 0; i < nums.length; i++) {
            bStree.add(nums[i]);
        }
        System.out.println("------");
       bStree.levelTraversal();
//        bStree.preOrder();
//        System.out.println("------");
//        bStree.preOrderNR();
//        System.out.println("------");
//        bStree.inOrder();
//        System.out.println("------");
//        bStree.postOrder();
//        System.out.println("------");
//        System.out.println(bStree);
        Thread thread = new Thread();
        Object o = new Object();
        Runnable runnable = new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println(Thread.currentThread().getName() + "---" + i);
                    if(i==3) {
                        try {
                            Thread.yield();
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
        };
        System.out.println(Thread.currentThread().getName());
        new Thread(runnable).start();
        System.out.println(Thread.currentThread().getName());

    }
}
